package cn.hamster3.hamsterworld.event;

import cn.hamster3.hamsterworld.data.WorldData;
import org.bukkit.WorldCreator;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

/**
 * 这个事件代表着私人世界创建完成
 */
@SuppressWarnings("unused")
public class PrivateWorldPostCreateEvent extends Event {
    private static HandlerList handlerList = new HandlerList();
    private WorldCreator worldCreator;
    private WorldData worldData;

    public PrivateWorldPostCreateEvent(WorldCreator worldCreator, WorldData worldData) {
        this.worldCreator = worldCreator;
        this.worldData = worldData;
    }

    public static HandlerList getHandlerList() {
        return handlerList;
    }

    /**
     * 获取世界的WorldCreator对象
     * <p>
     * 此时世界已经创建完成，所以对于该对象的更改已经不会再影响到世界的任何内容
     *
     * @return WorldCreator
     */
    public WorldCreator getWorldCreator() {
        return worldCreator;
    }

    public WorldData getWorldData() {
        return worldData;
    }

    @Override
    public HandlerList getHandlers() {
        return handlerList;
    }
}
